<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // Math.floor()   向下    floor地板
        // Math.ceil()    向上    ceil天花板
        // Math.round()   四舍五入  round环绕


        // parseInt()  parseInt  整数int   浮点数float     取整

        var a = 3.5;
        var b = Math.ceil(a);   // 4
        console.log(b);

        var b = Math.floor(a);   // 3
        console.log(b);

        var b = Math.round(a);   // 4
        console.log(b);

        var b = parseInt(a);
        console.log(b);   // 3

    </script>

</body>

</html>